#ifndef XGMMLCREATOR_H_
/**#define XGMMLCREATOR_H_*/

#include "stdio.h"
#include "structs.h"
#include <string.h>
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
#include <libxml/tree.h>

typedef struct{
	Vertex* vertexCollection;
	int size;
	char* color; /*Optional*/
}Cluster;

typedef struct{
	Cluster* clusterCollection;
	int size;
}ClusterSet;

struct ClusterListItem{
	Cluster* data;
	struct ClusterListItem* next;
};

typedef struct ClusterListItem ClusterListItem;

typedef struct{
	ClusterListItem* head;
}ClusterList;


char* GetVertexNameById(int id, Vertex* networkVertexs,int networkVertexsSize);
xmlDocPtr CreateXmlDocForNetwork(Edge* networkEdges,int networkEdgesSize,Vertex* networkVertexs,int networkVertexsSize);
int CompareCluster(Cluster* a, Cluster* b);
void InsertSorted(ClusterList* list, Cluster* cluster);
void AssignColors(ClusterList* sortedList);
xmlNodePtr GetVertextGraphicNodeById(xmlDocPtr pXMLDoc, int vertexId);
void UpdateXmlWithColors(xmlDocPtr pXMLDoc, Cluster* cluster ,char* color);
void CreateXgmml(xmlDocPtr pXMLDoc, ClusterSet* clusterSet,char* outputPath, int isBest);
Cluster* CreateCluster(int size, int startIndex);



#endif /* XGMMLCREATOR_H_ */
